#include "hltypes/hstring.h"
#include "Skeleton.h"
#include <iostream>

namespace askal
{
	
	Skeleton::Skeleton()
	{
		
	}
	
	Skeleton::~Skeleton()
	{
		
	}
	
	void Skeleton::addBone(askal::Bone bone)
	{
		mBones += bone;
	}
	
	
	Bone* Skeleton::getBone(chstr name)
	{
		for(int i = 0; i < mBones.size(); ++i)
		{
			if(mBones[i].mName == name)
				return &mBones[i];
		}
		return NULL;
	}
	
	int Skeleton::getBoneIndex(chstr name)
	{
		for(int i = 0; i < mBones.size(); ++i)
		{
			if(mBones[i].mName == name)
				return i;
		}
		return -1;
	}
	
	Animation* Skeleton::getAnimation(chstr name)
	{
		if(mAnimations.has_key(name))
			return &mAnimations[name];
	}
	
}
